<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
       
       #main{
        display: flex;
        width: 100%;
        border: 1px solid red;
        flex-wrap: wrap;
        /* justify-content:; */
        background-color: rgb(94, 114, 114);

       }
       .box{
        display: flex;
        flex-direction:column;
        justify-content: center;
        width: 200px;
        align-items:center;
        /* overflow: hidden; */
        background-color: white;
        margin: 20px;
        border-radius: 5px;
        padding: 5px;
       }
       .box img{
        width: 80%;
       }
       .box .brand{
        font-size: 14px;
        line-height: 20px;
        margin: 5px 0;
        height: 80px;
       }
       .box .introduce{
        font-size: 16px;
        margin: 5px 0;
        color: crimson;
       }
    



    </style>
</head>
<body>
    <div id="main"></div>
</body>
<script src="./index.js"></script>
<script>
    var str = "";
    data.forEach(function(val){
        str += '<div class="box"><img src = " '+ val.img +' " alt = ""><p class="brand">'+ val.proName +'</p><p class="introduce">价格：'+val.price+' 销量：'+val.sales+'</p></div>'
    })

    var main = document.getElementById("main");
    main.innerHTML = str;

</script>
</html>